<template>
    <div class="container">
        <div class="proName">
          <img style="height:35px;margin:12.5px 0 0 60px" src="@/assets/images/logo2.png" alt="">
<!--          <a style="margin-left: 100px;" v-on:click="goToOld">返回旧版</a>-->
        </div>
        <div class="procontainer">
            <div class="help" @click="gohelp">
                <svg-icon icon-class="bangzhu" style="font-size:20px;position: relative;top:3px"/>
                <!-- <i class="el-icon-question" style="font-size:20px;position: relative;top:3px"></i> -->
                <div>帮助教程</div>
            </div>
            <div class="setting">
                <!-- <div class="versions">
                    <el-button type="primary" plain size="mini" style="padding: 4px 6px;">企业版</el-button>
                </div> -->
                <div>
                    <svg-icon icon-class="morentouxiang" style="font-size:25px;position: relative;top:3px"/>
                    <el-dropdown @command="handleCommand">
                        <span style="cursor: pointer;">
                            {{ name }}<i class="el-icon-arrow-down el-icon--right"></i>
                        </span>
                        <el-dropdown-menu slot="dropdown">
                            <el-dropdown-item :command="1">基本资料</el-dropdown-item>
                            <el-dropdown-item :command="3" divided>退 出</el-dropdown-item>
                        </el-dropdown-menu>
                    </el-dropdown>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'Navbar',
    data() {
        return {
            name: this.$store.state.user.name
        }
    },
    methods: {
        handleCommand(command){

            switch(command) {
                case 1:
                    this.$router.push({ path: '/info/updatePW' })
                    break
                case 3:
                    this.$store.dispatch('user/logout');
                    break
            }
        },
        goToOld () {
            window.location.href = 'https://web.juanpao.com/adminMerchant';
        },
        gohelp () {
            console.log('todo')
            window.location.href = 'http://wen.juanpao.cn/web/#/1?page_id=1';
        }
    }
}
</script>

<style lang="css" scoped>
.container{
    padding: 0 15px;
    color:rgb(60,60,60)
}
.proName{
    float: left;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 1px;
}
.procontainer{
    float: right;
    width: 300px;
    font-size: 14px;
}
.procontainer>div{
    display: inline-block;
}
.help{
    float: left;
    cursor: pointer;
}
.help:active{
    color:cornflowerblue
}
.help>div{
    display: inline-block;
}
.setting{
    float: right;
    padding: 0 40px 0 0;
}
.setting>div{
    display: inline-block;
}
.versions{
    margin:0 15px;
}
</style>
